10dof 2.2.0
c10dof.h File Reference

This file contains API for 10DOF Click driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  c10dof_t
 Click ctx object definition. More...
struct  c10dof_cfg_t
 Click configuration structure definition. More...

Macros

#define C10DOF_MAP_MIKROBUS(cfg, mikrobus)
#define C10DOF_RETVAL   uint8_t
#define C10DOF_OK   0x00
#define C10DOF_INIT_ERROR   0xFF
#define C10DOF_BNO055_ADDRESS_A   0x28
#define C10DOF_BNO055_ADDRESS_B   0x29
#define C10DOF_BNO055_ID   0xA0
#define C10DOF_BNO055_PAGE_ID_ADDR   0x07
#define C10DOF_BNO055_CHIP_ID_ADDR   0x00
#define C10DOF_BNO055_ACCEL_REV_ID_ADDR   0x01
#define C10DOF_BNO055_MAG_REV_ID_ADDR   0x02
#define C10DOF_BNO055_GYRO_REV_ID_ADDR   0x03
#define C10DOF_BNO055_SW_REV_ID_LSB_ADDR   0x04
#define C10DOF_BNO055_SW_REV_ID_MSB_ADDR   0x05
#define C10DOF_BNO055_BL_REV_ID_ADDR   0X06
#define C10DOF_BNO055_ACCEL_DATA_X_LSB_ADDR   0x08
#define C10DOF_BNO055_ACCEL_DATA_X_MSB_ADDR   0x09
#define C10DOF_BNO055_ACCEL_DATA_Y_LSB_ADDR   0x0A
#define C10DOF_BNO055_ACCEL_DATA_Y_MSB_ADDR   0x0B
#define C10DOF_BNO055_ACCEL_DATA_Z_LSB_ADDR   0x0C
#define C10DOF_BNO055_ACCEL_DATA_Z_MSB_ADDR   0x0D
#define C10DOF_BNO055_MAG_DATA_X_LSB_ADDR   0x0E
#define C10DOF_BNO055_MAG_DATA_X_MSB_ADDR   0x0F
#define C10DOF_BNO055_MAG_DATA_Y_LSB_ADDR   0x10
#define C10DOF_BNO055_MAG_DATA_Y_MSB_ADDR   0x11
#define C10DOF_BNO055_MAG_DATA_Z_LSB_ADDR   0x12
#define C10DOF_BNO055_MAG_DATA_Z_MSB_ADDR   0x13
#define C10DOF_BNO055_GYRO_DATA_X_LSB_ADDR   0x14
#define C10DOF_BNO055_GYRO_DATA_X_MSB_ADDR   0x15
#define C10DOF_BNO055_GYRO_DATA_Y_LSB_ADDR   0x16
#define C10DOF_BNO055_GYRO_DATA_Y_MSB_ADDR   0x17
#define C10DOF_BNO055_GYRO_DATA_Z_LSB_ADDR   0x18
#define C10DOF_BNO055_GYRO_DATA_Z_MSB_ADDR   0x19
#define C10DOF_BNO055_EULER_H_LSB_ADDR   0x1A
#define C10DOF_BNO055_EULER_H_MSB_ADDR   0x1B
#define C10DOF_BNO055_EULER_R_LSB_ADDR   0x1C
#define C10DOF_BNO055_EULER_R_MSB_ADDR   0x1D
#define C10DOF_BNO055_EULER_P_LSB_ADDR   0x1E
#define C10DOF_BNO055_EULER_P_MSB_ADDR   0x1F
#define C10DOF_BNO055_QUATERNION_DATA_W_LSB_ADDR   0x20
#define C10DOF_BNO055_QUATERNION_DATA_W_MSB_ADDR   0x21
#define C10DOF_BNO055_QUATERNION_DATA_X_LSB_ADDR   0x22
#define C10DOF_BNO055_QUATERNION_DATA_X_MSB_ADDR   0x23
#define C10DOF_BNO055_QUATERNION_DATA_Y_LSB_ADDR   0x24
#define C10DOF_BNO055_QUATERNION_DATA_Y_MSB_ADDR   0x25
#define C10DOF_BNO055_QUATERNION_DATA_Z_LSB_ADDR   0x26
#define C10DOF_BNO055_QUATERNION_DATA_Z_MSB_ADDR   0x27
#define C10DOF_BNO055_LINEAR_ACCEL_DATA_X_LSB_ADDR   0x28
#define C10DOF_BNO055_LINEAR_ACCEL_DATA_X_MSB_ADDR   0x29
#define C10DOF_BNO055_LINEAR_ACCEL_DATA_Y_LSB_ADDR   0x2A
#define C10DOF_BNO055_LINEAR_ACCEL_DATA_Y_MSB_ADDR   0x2B
#define C10DOF_BNO055_LINEAR_ACCEL_DATA_Z_LSB_ADDR   0x2C
#define C10DOF_BNO055_LINEAR_ACCEL_DATA_Z_MSB_ADDR   0x2D
#define C10DOF_BNO055_GRAVITY_DATA_X_LSB_ADDR   0x2E
#define C10DOF_BNO055_GRAVITY_DATA_X_MSB_ADDR   0x2F
#define C10DOF_BNO055_GRAVITY_DATA_Y_LSB_ADDR   0x30
#define C10DOF_BNO055_GRAVITY_DATA_Y_MSB_ADDR   0x31
#define C10DOF_BNO055_GRAVITY_DATA_Z_LSB_ADDR   0x32
#define C10DOF_BNO055_GRAVITY_DATA_Z_MSB_ADDR   0x33
#define C10DOF_BNO055_TEMP_ADDR   0x34
#define C10DOF_BNO055_CALIB_STAT_ADDR   0x35
#define C10DOF_BNO055_SELFTEST_RESULT_ADDR   0x36
#define C10DOF_BNO055_INTR_STAT_ADDR   0x37
#define C10DOF_BNO055_SYS_CLK_STAT_ADDR   0x38
#define C10DOF_BNO055_SYS_STAT_ADDR   0x39
#define C10DOF_BNO055_SYS_ERR_ADDR   0x3A
#define C10DOF_BNO055_UNIT_SEL_ADDR   0x3B
#define C10DOF_BNO055_DATA_SELECT_ADDR   0x3C
#define C10DOF_BNO055_OPR_MODE_ADDR   0x3D
#define C10DOF_BNO055_PWR_MODE_ADDR   0x3E
#define C10DOF_BNO055_SYS_TRIGGER_ADDR   0x3F
#define C10DOF_BNO055_TEMP_SOURCE_ADDR   0x40
#define C10DOF_BNO055_AXIS_MAP_CONFIG_ADDR   0x41
#define C10DOF_BNO055_AXIS_MAP_SIGN_ADDR   0x42
#define C10DOF_BNO055_SIC_MATRIX_0_LSB_ADDR   0x43
#define C10DOF_BNO055_SIC_MATRIX_0_MSB_ADDR   0x44
#define C10DOF_BNO055_SIC_MATRIX_1_LSB_ADDR   0x45
#define C10DOF_BNO055_SIC_MATRIX_1_MSB_ADDR   0x46
#define C10DOF_BNO055_SIC_MATRIX_2_LSB_ADDR   0x47
#define C10DOF_BNO055_SIC_MATRIX_2_MSB_ADDR   0x48
#define C10DOF_BNO055_SIC_MATRIX_3_LSB_ADDR   0x49
#define C10DOF_BNO055_SIC_MATRIX_3_MSB_ADDR   0x4A
#define C10DOF_BNO055_SIC_MATRIX_4_LSB_ADDR   0x4B
#define C10DOF_BNO055_SIC_MATRIX_4_MSB_ADDR   0x4C
#define C10DOF_BNO055_SIC_MATRIX_5_LSB_ADDR   0x4D
#define C10DOF_BNO055_SIC_MATRIX_5_MSB_ADDR   0x4E
#define C10DOF_BNO055_SIC_MATRIX_6_LSB_ADDR   0x4F
#define C10DOF_BNO055_SIC_MATRIX_6_MSB_ADDR   0x50
#define C10DOF_BNO055_SIC_MATRIX_7_LSB_ADDR   0x51
#define C10DOF_BNO055_SIC_MATRIX_7_MSB_ADDR   0x52
#define C10DOF_BNO055_SIC_MATRIX_8_LSB_ADDR   0x53
#define C10DOF_BNO055_SIC_MATRIX_8_MSB_ADDR   0x54
#define C10DOF_ACCEL_OFFSET_X_LSB_ADDR   0x55
#define C10DOF_ACCEL_OFFSET_X_MSB_ADDR   0x56
#define C10DOF_ACCEL_OFFSET_Y_LSB_ADDR   0x57
#define C10DOF_ACCEL_OFFSET_Y_MSB_ADDR   0x58
#define C10DOF_ACCEL_OFFSET_Z_LSB_ADDR   0x59
#define C10DOF_ACCEL_OFFSET_Z_MSB_ADDR   0x5A
#define C10DOF_MAG_OFFSET_X_LSB_ADDR   0x5B
#define C10DOF_MAG_OFFSET_X_MSB_ADDR   0x5C
#define C10DOF_MAG_OFFSET_Y_LSB_ADDR   0x5D
#define C10DOF_MAG_OFFSET_Y_MSB_ADDR   0x5E
#define C10DOF_MAG_OFFSET_Z_LSB_ADDR   0x5F
#define C10DOF_MAG_OFFSET_Z_MSB_ADDR   0x60
#define C10DOF_GYRO_OFFSET_X_LSB_ADDR   0x61
#define C10DOF_GYRO_OFFSET_X_MSB_ADDR   0x62
#define C10DOF_GYRO_OFFSET_Y_LSB_ADDR   0x63
#define C10DOF_GYRO_OFFSET_Y_MSB_ADDR   0x64
#define C10DOF_GYRO_OFFSET_Z_LSB_ADDR   0x65
#define C10DOF_GYRO_OFFSET_Z_MSB_ADDR   0x66
#define C10DOF_ACCEL_RADIUS_LSB_ADDR   0x67
#define C10DOF_ACCEL_RADIUS_MSB_ADDR   0x68
#define C10DOF_MAG_RADIUS_LSB_ADDR   0x69
#define C10DOF_MAG_RADIUS_MSB_ADDR   0x6A
#define C10DOF_BMP180_ADDRESS   0x77
#define C10DOF_BMP180_PROM_START__ADDR   0xAA
#define C10DOF_BMP180_CHIP_ID_REG   0xD0
#define C10DOF_BMP180_VERSION_REG   0xD1
#define C10DOF_BMP180_CTRL_MEAS_REG   0xF4
#define C10DOF_BMP180_ADC_OUT_MSB_REG   0xF6
#define C10DOF_BMP180_ADC_OUT_LSB_REG   0xF7
#define C10DOF_BMP180_SOFT_RESET_REG   0xE0
#define C10DOF_BMP180_REG_CALIB_PARAM_AC1_MSB   0xAA
#define C10DOF_BMP180_REG_CALIB_PARAM_AC1_LSB   0xAB
#define C10DOF_BMP180_REG_CALIB_PARAM_AC2_MSB   0xAC
#define C10DOF_BMP180_REG_CALIB_PARAM_AC2_LSB   0xAD
#define C10DOF_BMP180_REG_CALIB_PARAM_AC3_MSB   0xAE
#define C10DOF_BMP180_REG_CALIB_PARAM_AC3_LSB   0xAF
#define C10DOF_BMP180_REG_CALIB_PARAM_AC4_MSB   0xB0
#define C10DOF_BMP180_REG_CALIB_PARAM_AC4_LSB   0xB1
#define C10DOF_BMP180_REG_CALIB_PARAM_AC5_MSB   0xB2
#define C10DOF_BMP180_REG_CALIB_PARAM_AC5_LSB   0xB3
#define C10DOF_BMP180_REG_CALIB_PARAM_AC6_MSB   0xB4
#define C10DOF_BMP180_REG_CALIB_PARAM_AC6_LSB   0xB5
#define C10DOF_BMP180_REG_CALIB_PARAM_B1_MSB   0xB6
#define C10DOF_BMP180_REG_CALIB_PARAM_B1_LSB   0xB7
#define C10DOF_BMP180_REG_CALIB_PARAM_B2_MSB   0xB8
#define C10DOF_BMP180_REG_CALIB_PARAM_B2_LSB   0xB9
#define C10DOF_BMP180_REG_CALIB_PARAM_MB_MSB   0xBA
#define C10DOF_BMP180_REG_CALIB_PARAM_MB_LSB   0xBB
#define C10DOF_BMP180_REG_CALIB_PARAM_MC_MSB   0xBC
#define C10DOF_BMP180_REG_CALIB_PARAM_MC_LSB   0xBD
#define C10DOF_BMP180_REG_CALIB_PARAM_MD_MSB   0xBE
#define C10DOF_BMP180_REG_CALIB_PARAM_MD_LSB   0xBF
#define C10DOF_BMP180_REG_CONF_ADDR   0x07
#define C10DOF_BMP180_PWR_MODE_ADDR   0x3E
#define C10DOF_BMP180_OPR_MODE_ADDR   0x3D
#define C10DOF_BMP180_T_MEASURE   0x2E
#define C10DOF_BMP180_P_MEASURE   0x34

Functions

void c10dof_cfg_setup (c10dof_cfg_t *cfg)
 Config Object Initialization function.
C10DOF_RETVAL c10dof_init (c10dof_t *ctx, c10dof_cfg_t *cfg)
 Initialization function.
void c10dof_default_cfg (c10dof_t *ctx)
 Click Default Configuration function.
void c10dof_write_byte (c10dof_t *ctx, uint8_t reg, uint8_t data_in, uint8_t slave_addr)
 Generic write function.
uint8_t c10dof_read_byte (c10dof_t *ctx, uint8_t reg, uint8_t slave_addr)
 Generic read function.
uint16_t c10dof_read_data (c10dof_t *ctx, uint8_t msb_reg, uint8_t slave_addr)
 Generic read function.
void c10dof_hw_reset (c10dof_t *ctx)
 Reset function.
uint8_t c10dof_bmp180_chip_ID (c10dof_t *ctx)
 ID function.
uint8_t c10dof_bno055_chip_ID (c10dof_t *ctx)
 ID function.
uint8_t c10dof_get_accel_ID (c10dof_t *ctx)
 ID function.
uint8_t c10dof_get_mag_ID (c10dof_t *ctx)
 ID function.
uint8_t c10dof_get_gyro_ID (c10dof_t *ctx)
 ID function.
uint16_t c10dof_get_soft_ID (c10dof_t *ctx)
 ID function.
uint8_t c10dof_get_page_ID (c10dof_t *ctx)
 ID function.
void c10dof_default_configuration_BMP180 (c10dof_t *ctx)
 Configuration function.
void c10dof_default_configuration_BNO055 (c10dof_t *ctx)
 Configuration function.
void c10dof_set_config_mode (c10dof_t *ctx, uint8_t config_mode)
 Configuration function.
void c10dof_select_page (c10dof_t *ctx, uint8_t page_number)
 Page selection function.
void c10dof_config_accel (c10dof_t *ctx, uint8_t acc_cnfg)
 Accel configuration function.
void c10dof_config_gyro (c10dof_t *ctx, uint8_t gyro_cnfg)
 Gyro configuration function.
void c10dof_config_mag (c10dof_t *ctx, uint8_t mag_cnfg)
 Mag configuration function.
void c10dof_set_sensor_units (c10dof_t *ctx, uint8_t sensor_units)
 Sensor units function.
uint8_t c10dof_get_system_status (c10dof_t *ctx)
 System status code.
uint8_t c10dof_get_system_error (c10dof_t *ctx)
 System error code.
void c10dof_set_mode (c10dof_t *ctx, uint8_t mode_val)
 Mode.
void c10dof_set_normal_mode (c10dof_t *ctx)
 Normal mode.
void c10dof_start_temperature_measure (c10dof_t *ctx)
 Temperature reading start.
void c10dof_start_pressure_measure (c10dof_t *ctx)
 Pressure reading start.
int16_t c10dof_read_raw_temperature (c10dof_t *ctx, uint8_t msb_reg)
 Raw temperature reading.
int32_t c10dof_read_raw_pressure (c10dof_t *ctx, uint8_t msb_addr)
 Raw pressure reading.
void c10dof_get_calib_param (c10dof_t *ctx)
 Read the calibration parameter function.
void c10dof_get_measurements (c10dof_t *ctx, float *temperature, float *pressure)
 Get measurements value - temperature and pressure data function.
float c10dof_get_temperature (c10dof_t *ctx)
 Get temperature value function.
float c10dof_get_pressure (c10dof_t *ctx)
 Get pressure value function.
int16_t c10dof_get_axis (c10dof_t *ctx, uint8_t addr_reg_low)
 Function get axis data of BNO055 register.
void c10dof_read_accel (c10dof_t *ctx, int16_t *accelX, int16_t *accelY, int16_t *accelZ)
 Function read Accel X-axis, Y-axis and Z-axis.
void c10dof_read_mag (c10dof_t *ctx, int16_t *magX, int16_t *magY, int16_t *magZ)
 Function read Magnetometar X-axis, Y-axis and Z-axis.
void c10dof_read_gyro (c10dof_t *ctx, int16_t *gyroX, int16_t *gyroY, int16_t *gyroZ)
 Function read Gyro X-axis, Y-axis and Z-axis axis.
uint8_t c10dof_check_interrupt (c10dof_t *ctx)
 Check the state of interrupt function.

Detailed Description

This file contains API for 10DOF Click driver.